using System.Data;
using ET;

namespace DA
{
	public class Part_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdtb_Part(string keywords)
	{
	return cls.Search("sp_tb_Part_Search", "@KeyWords", keywords);
	}
    //public DataTable BindGirdtb_PartDetail(int id)
    //{
    //}
	#endregion

	#region Insert
	public bool Inserttb_Part(Part_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Part_Name", data.Part_Name);
	cls.AddParameter("@Part_Note", data.Part_Note);
	cls.AddParameter("@Part_User_Add", data.Part_User_Add);
	cls.AddParameter("@Part_Date_Add", data.Part_Date_Add);
	cls.AddParameter("@Part_Computer_Add", data.Part_Computer_Add);
	cls.AddParameter("@Part_User_Modify", data.Part_User_Modify);
	cls.AddParameter("@Part_Date_Modify", data.Part_Date_Modify);
	cls.AddParameter("@Part_Computer_Modify", data.Part_Computer_Modify);
	cls.ExecuteNonQuery("sp_tb_Part_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool Updatetb_Part(Part_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Part_ID", data.Part_ID);
	cls.AddParameter("@Part_Name", data.Part_Name);
	cls.AddParameter("@Part_Note", data.Part_Note);
	cls.AddParameter("@Part_User_Add", data.Part_User_Add);
	cls.AddParameter("@Part_Date_Add", data.Part_Date_Add);
	cls.AddParameter("@Part_Computer_Add", data.Part_Computer_Add);
	cls.AddParameter("@Part_User_Modify", data.Part_User_Modify);
	cls.AddParameter("@Part_Date_Modify", data.Part_Date_Modify);
	cls.AddParameter("@Part_Computer_Modify", data.Part_Computer_Modify);
	cls.ExecuteNonQuery("sp_tb_Part_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool Deletetb_Part(int id)
	{
        cls.Delete("sp_tb_Part_Delete", "@Part_Id", id);
        return true;
	}
	#endregion
	}
}